<h1>文章列表</h1>

<%= link_to '写文章', new_article_path %>
<table>
  <tr>
    <th>标题</th>
    <th>内容</th>
  </tr>

  <% @articles.each do |article| %>
      <tr>
        <td><%= article.title %></td>
        <td><%= article.text %></td>
        <td><%= link_to '显示', article_path(article) %></td>
        <td><%= link_to '编辑', edit_article_path(article) %></td>
        <td><%= link_to '删除', article_path(article), method: :delete, data:{confirm:"确定删除文章"} %></td>
      </tr>
  <% end %>
</table>

